home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7229 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: pacer1.usca.sc.edu!dwb
  2. From: dwb@I_should_put_my_domain_in_etc_NNTP_INEWS_DOMAIN (David Botsch)
  3. Newsgroups: comp.lang.c++
  4. Subject: Sound & C++
  5. Date: 21 Feb 1996 23:02:45 GMT
  6. Organization: University of South Carolina - Columbia - Computer Science
  7. Message-ID: <4gg8al$h5v@redwood.cs.sc.edu>
  8. NNTP-Posting-Host: pacer1.usca.sc.edu
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. I would like to be able to program my sound card
  12. in C++. I have done this so far with
  13. fopen and fwrite to /dev/audio1.
  14. I am attempting to create a sine wave, so that
  15. I can modify the frequency and amplitude of the
  16. wave to modify the volume and pitch of the sound.
  17. The algorithm creating a sine wave works fine.
  18. However, if I fwrite the constantly changing
  19. values to my sound card, I am greeted with noise.
  20. fwriting a constant value to /dev/audio1 produces
  21. the same tone, no matter the value. It would appeear
  22. that the sound card somehow creates its own sin wave
  23. using my method.
  24. So the question is, how do I, in C++, send data to the
  25. sound card? As I mentioned, I would like to be able
  26. to create a sine wave, so I can then modify the quality
  27. by dividing by 44 or 127, etc.
  28. A private e-mail response is preferred so that I don't
  29. have to search through the newsgroup for a response.
  30. Thanks for all assistance!
  31. Respond to: dwb@pacer1.usca.sc.edu
  32. -David Botsch
  33.  
  34.